package com.example.myapplication

import android.os.Bundle
import android.os.PersistableBundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.example.myapplication.databinding.ActivityBuyBinding
import com.example.myapplication.presenter.BuyPersenter
import com.example.myapplication.view.IBuyView

class BuyActivity : AppCompatActivity(),IBuyView {
    private val TAG = "BuyActivity"
    private lateinit var  buyPersenter:BuyPersenter
    private lateinit var binding: ActivityBuyBinding
    override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
        super.onCreate(savedInstanceState, persistentState)
        binding = ActivityBuyBinding.inflate(layoutInflater)
        setContentView(R.layout.activity_buy)
        buyPersenter =BuyPersenter(this)
        initView()
    }

    private fun initView() {
        // 初始化视图
        binding.tv1.setText("hello")
    }

    override fun getNameSuccess() {
        Log.d(TAG, "getNameSuccess: "+binding.tv1.text)
    }
}